-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User Tasks: add discover-ec2
task type
#47062
Conversation
4e32211
to
873c321
Compare
5e20588
to
497f0aa
Compare
const ( | ||
// TaskTypeDiscoverEC2 identifies a User Tasks that is created | ||
// when an auto-enrollment of an EC2 instance fails. | ||
// UserTasks that have this Task Type must include the DiscoverEC2 field. | ||
TaskTypeDiscoverEC2 = "discover-ec2" | ||
) | ||
|
||
// discoverEC2IssueTypes is a list of issue types that can occur when trying to auto enroll EC2 instances. | ||
var discoverEC2IssueTypes = []string{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we move this closer to the types definition so it's easier to keep them aligned?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can change it 👍
The reasoning here is that I was trying to not add usertasks specific things to types
.
I was also trying to add generic EC2 Auto Discover failures so that we can use them everywhere, even if not related to usertasks.
Well, thinking about this now, I think it's fine to not pursue one of the above goals.
I'll move the identifiers from types
into usertasks
.
This PR adds more business logic into the User Tasks, in particular into the `discover-ec2` task type. One of the key features of the DiscoverEC2 User Tasks is that we must have a single task per: - integration - region - account id - issue type This allows user to have a detailed view of the issues their are facing but still grouping EC2 instances. To do this, we had to move the region and account id up one level. Previously they were at the instance level, and it would require iterating over them to actually create the group (uniq key) we want. This also adds well known errors as issue types to ensure we validate them. A later PR will come where we actually start creating/updating DiscoverEC2 User Tasks from the DiscoveryService.
497f0aa
to
649c8be
Compare
649c8be
to
43cbfc1
Compare
@marcoandredinis See the table below for backport results.
|
* User Tasks: add `discover-ec2` task type This PR adds more business logic into the User Tasks, in particular into the `discover-ec2` task type. One of the key features of the DiscoverEC2 User Tasks is that we must have a single task per: - integration - region - account id - issue type This allows user to have a detailed view of the issues their are facing but still grouping EC2 instances. To do this, we had to move the region and account id up one level. Previously they were at the instance level, and it would require iterating over them to actually create the group (uniq key) we want. This also adds well known errors as issue types to ensure we validate them. A later PR will come where we actually start creating/updating DiscoverEC2 User Tasks from the DiscoveryService. * use strings.Compare * improve docs and fix typos
* User Tasks: add `discover-ec2` task type This PR adds more business logic into the User Tasks, in particular into the `discover-ec2` task type. One of the key features of the DiscoverEC2 User Tasks is that we must have a single task per: - integration - region - account id - issue type This allows user to have a detailed view of the issues their are facing but still grouping EC2 instances. To do this, we had to move the region and account id up one level. Previously they were at the instance level, and it would require iterating over them to actually create the group (uniq key) we want. This also adds well known errors as issue types to ensure we validate them. A later PR will come where we actually start creating/updating DiscoverEC2 User Tasks from the DiscoveryService. * use strings.Compare * improve docs and fix typos
This PR adds more business logic into
discover-ec2
User Task.One of the key features of the DiscoverEC2 User Tasks is that we must have a single task per:
This allows user to have a detailed view of the issues their are facing but still grouping EC2 instances.
To do this, we had to move the region and account id up one level. Previously they were at the instance level, and it would require iterating over them to actually create the group (uniq key) we want.
This also adds well known errors as issue types so that we can do validations on the tasks.
A later PR will come where we actually start creating/updating DiscoverEC2 User Tasks from the DiscoveryService.
Context: #41909